//
//  MGPassCodeControl.h
//  Mango
//
//  Created by 胡超 on 2021/6/27.
//  Copyright © 2021 HuChao. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@class MGPassCodeControl;
@protocol MGPassCodeControlDelegate <NSObject>
- (void)passCodeControl:(MGPassCodeControl *)passCodeControl didInputCode:(NSString *)code;
@end

@interface MGPassCodeControl : UIView

@property (nonatomic,assign) CGSize  codeSize;
@property (nonatomic,assign) CGFloat codeSpace;
@property (nonatomic,assign) BOOL secureTextEntry;

@property (nonatomic,copy,nullable) void(^normalConfiguration)(UILabel *codeView);
@property (nonatomic,copy,nullable) void(^selectConfiguration)(UILabel *codeView);

@property (nonatomic,weak) id<MGPassCodeControlDelegate> delegate;

@property (nonatomic,readonly) NSInteger codeLength;
@property (nonatomic,readonly) NSString *codeString;

- (instancetype)initWithCodeLength:(NSInteger)codeLength;

@end

NS_ASSUME_NONNULL_END
